package com.juzipi.demo.client;

import com.juzipi.demo.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//声明 feign 客户端接口
//指定微服务名
@FeignClient(value = "service-provider",fallback = UserClientFallback.class)
public interface UserClient {

    //最好不要写全局路径，写到方法上也可以
    @GetMapping("user/{id}")
    public User findById(@PathVariable("id") Integer id);
}
